package yxy.game.pm2.bean.db.po;

import yxy.apple.db.ResultObjectBuilder;

import java.util.Date;

public class MailPo {
    private String pCode;
    private String code;
    private int type;// 标题
    private String title;// 标题
    private String content;// 内容
    private String rewards;
    private String reason;// 奖励原因
    private boolean readed; // 已读
    private boolean rewarded;// 已领奖
    private Date sendTime;
    private Date expiryTime;
    private long updateTime;

    public MailPo() {
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getpCode() {
        return pCode;
    }

    public void setpCode(String pCode) {
        this.pCode = pCode;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public boolean isReaded() {
        return readed;
    }

    public void setReaded(boolean readed) {
        this.readed = readed;
    }

    public boolean isRewarded() {
        return rewarded;
    }

    public void setRewarded(boolean rewarded) {
        this.rewarded = rewarded;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Date getExpiryTime() {
        return expiryTime;
    }

    public void setExpiryTime(Date expiryTime) {
        this.expiryTime = expiryTime;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getRewards() {
        return rewards;
    }

    public void setRewards(String rewards) {
        this.rewards = rewards;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public static ResultObjectBuilder<MailPo> builder = rs -> {
        MailPo u = new MailPo();
        u.setpCode(rs.getString("pCode"));
        u.setCode(rs.getString("code"));
        u.setType(rs.getInt("type"));
        u.setTitle(rs.getString("title"));
        u.setContent(rs.getString("content"));
        u.setRewards(rs.getString("rewards"));
        u.setReason(rs.getString("reason"));
        u.setReaded(rs.getBoolean("readed"));
        u.setRewarded(rs.getBoolean("rewarded"));
        u.setSendTime(rs.getTimestamp("sendTime"));
        u.setExpiryTime(rs.getTimestamp("expiryTime"));
        u.setUpdateTime(rs.getLong("updateTime"));
        return u;
    };
}
